package top.csy8888.ch02.config;

import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.csy8888.ch02.common.MinioFactoryBean;

/**
 * @author CSY
 * @date 2025 - 09 - 04
 */
@Configuration
public class MinioConfig {

    /**
     * 装配MinioFactoryBean
     * @return
     */
    @Bean
    public MinioFactoryBean minioClient() {
        MinioFactoryBean minioFactoryBean = new MinioFactoryBean();
        minioFactoryBean.setHost("http://127.0.0.1:9000");
        minioFactoryBean.setAccount("csy");
        minioFactoryBean.setPassword("csy11348336");
        minioFactoryBean.setBucketName("myapp");
        return minioFactoryBean;
    }
}
